/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scactbtipevi")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scactbtipevi.findAll", query = "SELECT s FROM Scactbtipevi s"),
    @NamedQuery(name = "Scactbtipevi.findByScactbtipeviid", query = "SELECT s FROM Scactbtipevi s WHERE s.scactbtipeviid = :scactbtipeviid"),
    @NamedQuery(name = "Scactbtipevi.findByNombre", query = "SELECT s FROM Scactbtipevi s WHERE s.nombre = :nombre")})
public class Scactbtipevi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scactbtipeviid")
    private Integer scactbtipeviid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "nombre")
    private String nombre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scactbtipeviid")
    private Collection<Scactbindevi> scactbindeviCollection;

    public Scactbtipevi() {
    }

    public Scactbtipevi(Integer scactbtipeviid) {
        this.scactbtipeviid = scactbtipeviid;
    }

    public Scactbtipevi(Integer scactbtipeviid, String nombre) {
        this.scactbtipeviid = scactbtipeviid;
        this.nombre = nombre;
    }

    public Integer getScactbtipeviid() {
        return scactbtipeviid;
    }

    public void setScactbtipeviid(Integer scactbtipeviid) {
        this.scactbtipeviid = scactbtipeviid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    @XmlTransient
    public Collection<Scactbindevi> getScactbindeviCollection() {
        return scactbindeviCollection;
    }

    public void setScactbindeviCollection(Collection<Scactbindevi> scactbindeviCollection) {
        this.scactbindeviCollection = scactbindeviCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scactbtipeviid != null ? scactbtipeviid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scactbtipevi)) {
            return false;
        }
        Scactbtipevi other = (Scactbtipevi) object;
        if ((this.scactbtipeviid == null && other.scactbtipeviid != null) || (this.scactbtipeviid != null && !this.scactbtipeviid.equals(other.scactbtipeviid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scactbtipevi[ scactbtipeviid=" + scactbtipeviid + " ]";
    }
    
}
